const http = require('http');
const server = http.createServer((request,response)=>{
    let body = [];
    request.on('error',(error)=>{
        console.log(error)
    }).on('data',(chunk)=>{
        body.push(chunk);
    }).on('end',()=>{
        body = Buffer.concat(body).toString();
        console.log('body接收到的消息',body);
        response.writeHead(200,{'Content-type':'text/html'});
        response.write('Hello World\n');
    })
});
server.listen(8888,()=>{
    console.log('启动服务监听-8888')
})